package com.sairobo.admin.modules.srblive.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sairobo.base.common.entity.Page;
import com.sairobo.base.common.entity.Query;
import com.sairobo.base.common.entity.R;
import com.sairobo.base.common.utils.CommonUtils;
import com.sairobo.admin.modules.srblive.entity.SrbliveUserDetail;
import com.sairobo.admin.modules.srblive.manager.SrbliveUserDetailManager;
import com.sairobo.admin.modules.srblive.service.SrbliveUserDetailService;

/**
 * 知心云用户详情
 *
 * @author admin
 * @email sairobo
 * @url www.sairobo.com
 * @date 2018年1月11日 上午11:07:24
 */
@Service("srbliveUserDetailService")
public class SrbliveUserDetailServiceImpl implements SrbliveUserDetailService {

	@Autowired
	private SrbliveUserDetailManager srbliveUserDetailManager;

	@Override
	public Page<SrbliveUserDetail> listSrbliveUserDetail(Map<String, Object> params) {
		Query query = new Query(params);
		Page<SrbliveUserDetail> page = new Page<>(query);
		srbliveUserDetailManager.listSrbliveUserDetail(page, query);
		return page;
	}

	@Override
	public R saveSrbliveUserDetail(SrbliveUserDetail role) {
		int count = srbliveUserDetailManager.saveSrbliveUserDetail(role);
		return CommonUtils.msg(count);
	}

	@Override
	public R getSrbliveUserDetailById(Long id) {
		SrbliveUserDetail srbliveUserDetail = srbliveUserDetailManager.getSrbliveUserDetailById(id);
		return CommonUtils.msg(srbliveUserDetail);
	}

	@Override
	public R updateSrbliveUserDetail(SrbliveUserDetail srbliveUserDetail) {
		int count = srbliveUserDetailManager.updateSrbliveUserDetail(srbliveUserDetail);
		return CommonUtils.msg(count);
	}

	@Override
	public R batchRemove(Long[] id) {
		int count = srbliveUserDetailManager.batchRemove(id);
		return CommonUtils.msg(id, count);
	}

}
